import math

def cal_cross_point(x, y):
    """
    计算商船与cd的距离
    :param point:当前商船坐标
    :return:交点坐标
    """
    x1 = 233.2359569
    y1 = 0
    x2 = 0
    y2 = 233.2359569

    x3 = 0
    y3 = 0
    x4 = x
    y4 = y

    k1 = (y2 - y1) * 1.0 / (x2 - x1)  # 计算k1,由于点均为整数，需要进行浮点数转化
    b1 = y1 * 1.0 - x1 * k1 * 1.0  # 整型转浮点型是关键
    if (x4 - x3) == 0:  # L2直线斜率不存在操作
        k2 = None
        b2 = 0
    else:
        k2 = (y4 - y3) * 1.0 / (x4 - x3)  # 斜率存在操作
        b2 = y3 * 1.0 - x3 * k2 * 1.0
    if k2 == None:
        x = x3
    else:
        x = (b2 - b1) * 1.0 / (k1 - k2)
    y = k1 * x * 1.0 + b1 * 1.0
    return [x, y]
